package com.baizhi.controller;

import com.baizhi.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
public class LogController {
    @Autowired
    private LogService ls;

    @RequestMapping("fyLog")
    @ResponseBody
    public Map fy(int page, int rows,String name){
        return ls.fy(page,rows,name);
    }

    @RequestMapping("deleteLog")
    @ResponseBody
    public Map delete(int [] id){
        Map map = new HashMap();
        try {
            ls.delete(id);
            map.put("mydeleteLog",true);
        } catch (Exception e) {
            map.put("mydeleteLog",false);
            e.printStackTrace();
        }
        return map;
    }

}
